import Vue from "vue"
import Vuex from "vuex"

import mutations from "./mutations"
import actions from "./actions"
import getters from "./getters"

import ModuleA from "./modules/ModuleA"

// 第一步: 引入插件后, 调用Vue.use() 来进行install Vuex
Vue.use(Vuex)

const state = {
  count : 100,
  students : [
    {id: 110, name: "xiaoLam", age:18 },
    {id: 111, name: "kobe", age: 20},
    {id:112, name: "suoer", age: 23},
    {id:113, name: "yangcong", age: 12}
  ],
  info : { id : 102, name : "fanghuonv", age : 16 }
}
const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
  modules : {
    ModuleA
  }
})

// 第三步: 导出
export default store